package org.fhm.zdte.common.protocol;

import org.fhm.zdte.common.constant.protocol.ContentType;
import org.fhm.zdte.common.constant.protocol.PacketType;
import org.fhm.zdte.common.constant.protocol.ResponseMessageType;
import org.fhm.zdte.common.pojo.Address;
import org.fhm.zdte.common.standard.ISubCmd;

/**
 * The abstract layer of the Packet-Message-Object.
 *
 * @author 谭波
 * @since 2023/11/4
 */
public abstract class AbstractMessageStandard {

    /**
     * Packet-Head: packet type.
     *
     * @return packet type.
     */
    public abstract PacketType getPacketType();

    /**
     * @return Packet-Head: the type of sub instruction.
     */
    public abstract ISubCmd getPacketSubType();

    /**
     * @return Packet-Head: the type of response message.
     */
    public abstract ResponseMessageType getResponseMessageType();

    /**
     * @return Packet-Head: the identification of the sender side.
     */
    public abstract String getFrom();

    /**
     * @return Packet-Head: the identification of the receiver side.
     */
    public abstract String getTo();

    /**
     * @return Packet-Head: the address of the sender side.
     */
    public abstract Address getFromAddress();

    /**
     * @return Packet-Head: the address of the receiver side.
     */
    public abstract Address getToAddress();

    /**
     * @return Packet-Head: the packet message number that is a 32-digit uuid.
     */
    public abstract String getMessageNumber();

    /**
     * @return Packet-Head: the message serial number that is the sequence number of the message after the packet content is split.
     */
    public abstract Integer getSerialNumber();

    /**
     * @return Packet-Head: the message length specifies how many packets are split into Packet-Contents.
     */
    public abstract Integer getMessageLength();

    /**
     * @return Packet-Head: a connection to B requires a secret key that meets the requirements of the B side.
     */
    public abstract String getSecretKey();

    /**
     * @return Packet-Head: Content-Type.
     */
    public abstract ContentType getContentType();

    /**
     * Set Content-Type
     */
    public abstract AbstractMessageStandard setContentType(ContentType contentType);

    /**
     * @return Packet-Head: the message content.
     */
    public abstract byte[] getContent();

}
